using System.Collections;
using System.Collections.Generic;
using UnityEngine;

// 创建一个菜单项，用于在Unity编辑器中创建这个效果的实例
[CreateAssetMenu(fileName = "Thunder strike effect", menuName = "Data/Item effect/Thunder strike")]
public class ThunderStrike_Effect : ItemEffect
{
    // 序列化字段，使其在Unity编辑器中可见
    [SerializeField] private GameObject thunderStrikePrefab;

    // 重写基类的ExecuteEffect方法
    public override void ExecuteEffect(Transform _enemyPosition)
    {
        // 在敌人位置生成雷击效果的实例
        GameObject newThunderStrike = Instantiate(thunderStrikePrefab, _enemyPosition.position, Quaternion.identity);
        // 1秒后销毁雷击效果的实例
        Destroy(newThunderStrike, 1f);
    }
}